package team.yidong.fenda.repository;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import team.yidong.fenda.entity.HospitalProfileImg;

import java.util.List;

/**
 * Created by xuanlong on 2018/3/15.
 */
@Repository
public interface HospitalProfileImgRepository extends JpaRepository<HospitalProfileImg, Integer> {
    @Query("select hospitalProfileImg.imgPath from HospitalProfileImg hospitalProfileImg where hospitalProfileImg.hospitalProfileId=?1 and hospitalProfileImg.status='use'")
    List<String> findHospitalProfileImg(Integer hospitalProfileId);

    @Query("select hospitalProfileImg from HospitalProfileImg hospitalProfileImg where hospitalProfileImg.hospitalProfileId=?1 and hospitalProfileImg.status='use'")
    List<HospitalProfileImg> findHospitalProfileImgByHospitalProfileId(Integer hospitalProfileId);
}
